<?php

// +----------------------------------------------------------------------
// |Author: 翼小菜
// +----------------------------------------------------------------------
// |Description: 后台用户头像API
// +----------------------------------------------------------------------
// |更多功能可联系QQ314688769
// +----------------------------------------------------------------------
namespace api\cveadmin\controller;
use cmf\controller\RestAdminBaseController;
use api\cveadmin\model\UserModel;
class AvatarController extends RestAdminBaseController
{
    /** 
     * 后台用户保存头像
     * @return {*}
     */    
    public function saveAvatar()
    {
        $param = $this->request->param();
        $userId = $this->getUserId();
        $user = UserModel::find($userId);
        $user->avatar = $param['avatar'];
        $user->save();
        $this->success('success');
    }
}